﻿<gui:OptionPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:sd="http://icsharpcode.net/sharpdevelop/core"
                 xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels"
                 x:Name="window"
                 x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.SelectCulturePanel">
	<gui:OptionPanel.Resources>
		<Style TargetType="{x:Type ListView}" BasedOn="{StaticResource {x:Type ListBox}}">
			<Setter Property="BorderBrush" Value="Black" />
			<Setter Property="BorderThickness" Value="0.5" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate>
						<Border Name="bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}">
							<ScrollViewer Margin="{TemplateBinding Padding}">
								<WrapPanel ItemWidth="96" ItemHeight="64" IsItemsHost="True" MinWidth="50" Width="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"></WrapPanel>
							</ScrollViewer>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
			<Setter Property="Padding" Value="3" />
			<Setter Property="HorizontalContentAlignment" Value="Center" />
			<Setter Property="ContentTemplate">
				<Setter.Value>
					<DataTemplate>
						<Grid HorizontalAlignment="Center" VerticalAlignment="Top">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>
							<Image HorizontalAlignment="Center" Width="32">
								<Image.Source>
									<BitmapImage UriSource="{Binding ImagePath}" DecodePixelWidth="32" DecodePixelHeight="24" />
								</Image.Source>
							</Image>
							<TextBlock Grid.Row="1" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding Name}" />
						</Grid>
					</DataTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ImageView},ResourceId=ImageView}" />
		<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ImageView},ResourceId=ImageViewItem}" />
	</gui:OptionPanel.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<ListView x:Name="listView" Margin="5,0" Height="200" SelectedItem="{sd:OptionBinding local:SelectCulturePanel.CurrentLanguage}">
			<ListView.View>
				<local:ImageView />
			</ListView.View>
		</ListView>
		<TextBlock Grid.Row="1" Margin="5,0">
			<TextBlock.Text>
				<MultiBinding StringFormat="{}{0} {1}">
					<sd:LocalizeExtension Key="Dialog.Options.IDEOptions.SelectCulture.CurrentUILanguageLabel" />
					<Binding Path="SelectedItem.Name" ElementName="listView" />
				</MultiBinding>
			</TextBlock.Text>
		</TextBlock>
		<!--<TextBlock Grid.Row="2" Margin="5,0">
			<TextBlock.Text>
				<MultiBinding StringFormat="{}{0} {1}">
					<sd:LocalizeExtension Key="Dialog.Options.IDEOptions.SelectCulture.CurrentUILanguageLabel" />
					<Binding Path="CurrentLanguage.Name" ElementName="window" />
				</MultiBinding>
			</TextBlock.Text>
		</TextBlock>-->
		<TextBlock Grid.Row="3" TextWrapping="Wrap" Text="{sd:Localize Dialog.Options.IDEOptions.SelectCulture.DescriptionText}" Margin="5" />
	</Grid>
</gui:OptionPanel>